class Good {
public double weight;
public void oldSetWeight(double w) {
	weight= w;
	System.out.println("double 型的weight="+weight);
	}
public double oldGetPrice() {
	double price=weight *10;
	return price;
	}
}
class CheapGoods extends Good{
	public int weight;
	public void newSetWeight(int w) {
	weight=w;
	System.out.println("int型的weighht="+weight);
	}
public double newGetPrice() {
	double price =weight*10;
	return price;
	}
}
public class p117 {
	public static  void main (String args[]) {
	CheapGoods cheapgoods=new CheapGoods();
	cheapgoods .newSetWeight(198);
	System.out.println("对象cheapgood的weight的值是"+cheapgoods.weight);
	System.out.println("对象cheapgood的weight新值是"+cheapgoods.newGetPrice());
	cheapgoods.oldSetWeight(198.987);
	System.out.println("对象cheapgood的weight的无优惠的值是"+cheapgoods.oldGetPrice());
	}
}	
